package test.threadlocal;

public class MyFilter {
    public static void main(String[] args) {
        new MyFilter().doFilter();
    }
    private MyDispatcherServlet servlet=new MyDispatcherServlet();
    public void doFilter(){
        System.out.println("[过滤器]执行方法");
        String userName="王翠花";
        MyThreadLocalUtil.save(userName);
        System.out.println("[过滤器]在线程上游存储数据:"+userName);
        //向后调用
        servlet.service();
    }
}
